//
//  WKSubmitBookCell.m
//  WKMaybell
//
//  Created by 何文虎 on 2018/12/17.
//  Copyright © 2018 何文虎. All rights reserved.
//

#import "WKSubmitBookCell.h"

@implementation WKSubmitBookCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        if ([reuseIdentifier isEqualToString:@"BOOKTITLEVIEW"]) {
            [self setupTitleView];
        }
        if ([reuseIdentifier isEqualToString:@"BOOKTAGVIEW"]) {
            [self setuptagView];
        }
        
        if ([reuseIdentifier isEqualToString:@"BOOKCONTENTVIEW"]) {
            [self setupContentView];
        }
        
        if ([reuseIdentifier isEqualToString:@"BOOKVISIBLEVIEW"]) {
            [self setupvisibleView];
        }
        
    }
    return self;
}

- (void)setupTitleView{
    UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(12, 10, 60, 14)];
    lable.text = @"计划名称";
    lable.textColor = UIColorFromHex(0x3C3C3C);
    lable.font = PFSC_MediumFont(15);
    [self.contentView addSubview:lable];
    
    UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(80, 10, ScreenWidth-92, 14)];
    textField.placeholder = @"输入标题,6~14个字";
    [self.contentView addSubview:textField];
    
}

- (void)setuptagView{
    UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(12, 10, 60, 14)];
    lable.text = @"选择话题";
    lable.textColor = UIColorFromHex(0x3C3C3C);
    lable.font = PFSC_MediumFont(15);
    [self.contentView addSubview:lable];
    
    UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(80, 10, ScreenWidth-92, 14)];
    textField.placeholder = @"添加标签";
    [self.contentView addSubview:textField];
    
}

- (void)setupContentView{
    
    UITextView *textView = [[UITextView alloc]initWithFrame:CGRectMake(12, 0, ScreenWidth-24, 330)];
    textView.placeholder = @"想美~就要大胆问出来";
    [self.contentView addSubview:textView];
    
}

- (void)setupvisibleView{
    
    UIButton *myselfBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [myselfBtn setTitle:@"仅自己可见" forState:UIControlStateNormal];
    [myselfBtn setTitleColor:UIColorFromHex(0x3C3C3C) forState:UIControlStateNormal];
    [self.contentView addSubview:myselfBtn];
    myselfBtn.frame = CGRectMake(12, 7, 120, 30);
    
    UIButton *allBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [allBtn setTitle:@"所有人可见" forState:UIControlStateNormal];
    [allBtn setTitleColor:UIColorFromHex(0x3C3C3C) forState:UIControlStateNormal];
    [self.contentView addSubview:allBtn];
     allBtn.frame = CGRectMake(120+12+30, 7, 120, 30);
    
    myselfBtn.backgroundColor = [UIColor yellowColor];
    allBtn.backgroundColor = [UIColor cyanColor];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
